home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
macros
/
latex209
/
contrib
/
custom-bib
/
genbst.mbs
(
.txt
)
< prev
next >
Wrap
LaTeX Document
|
1994-04-21
|
75KB
|
2,406 lines
%\iffalse
%/////////////////////////////////////////
% Generic bibliography style /
% for both author-year and numerical /
% for natbib, harvard, astron styles /
% authordate, and apalike /
%/////////////////////////////////////////
% This file is self-documenting: simply LaTeX it!
%% (Here are the specifications of the source file)
%<*selfdoc>
\ifx\undefined\endoptions\def\next{%
\documentstyle[a4,11pt,doc]{article}%
\def\skipguard##1>{}\MakePercentIgnore\skipguard}\else\let\next\relax\fi
\next
%</selfdoc>
%% \def\filename{genbst.mbs}
%% \def\filedate{1994 February 7}
%% \def\fileversion{1.2}
% \def\docdate{1994 February 7}
%\iffalse
% For use with docstrip to select various style parameters
% Default is an author-year bib style designed for my natbib.sty,
% which can also handle numerical citations.
%% For use with BibTeX version 0.99a or later, LaTeX version 2.09
%%-------------------------------------------------------------------
%% NOTICE:
%% This file may be used for non-profit purposes.
%% It may not be distributed in exchange for money,
%% other than distribution costs.
%%
%% The author provides it `as is' and does not guarantee it in any way.
%% Copyright (C) 1993 Patrick W. Daly
%% Max-Planck-Institut f\"ur Aeronomie
%% Postfach 20
%% D-37189 Katlenburg-Lindau
%% Germany
%% E-mail:
%% SPAN-- nsp::linmpi::daly (note nsp also known as ecd1)
%% Internet-- daly@linmpi.dnet.gwdg.de
%%-----------------------------------------------------------
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%% Digits \0\1\2\3\4\5\6\7\8\9
%% Exclamation \! Double quote \" Hash (number) \#
%% Dollar \$ Percent \% Ampersand \&
%% Acute accent \' Left paren \( Right paren \)
%% Asterisk \* Plus \+ Comma \,
%% Minus \- Point \. Solidus \/
%% Colon \: Semicolon \; Less than \<
%% Equals \= Greater than \> Question mark \?
%% Commercial at \@ Left bracket \[ Backslash \\
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
% \CodelineIndex
% \OnlyDescription
% \setcounter{StandardModuleDepth}{1}
% \begin{document}
% \setcounter{IndexColumns}{2}
% \setlength{\IndexMin}{10cm}
% \changes{1.0}{1993 Aug 16}{Initial version}
% \changes{1.2}{1994 Feb 7}{Add {\tt thtit-a} to format thesis titles
% as articles, not books}
% \pagestyle{headings}
% \title{\bf A Generic Bibliographic Style File}
%
% \author{Patrick W. Daly\thanks{E-mail: {\tt daly@linmpi.dnet.gwdg.de}}\\
% Max-Planck-Institut f\"ur Aeronomie\\
% D--37189 Katlenburg-Lindau, Germany}
%
% \date{This paper describes file {\tt\lowercase\expandafter{\filename}},\\
% version \fileversion{} from \filedate{},\\
% documentation from \docdate.}
% \maketitle
% \MakeShortVerb{\|}
% \parskip=1ex \parindent=0pt
% \newcommand{\btx}{{\sc Bib}\TeX}
% \section{Introduction}
% This generic, or master, \btx{} style file is intended to be used with
% {\tt docstrip} in order to produce actual {\tt.bst} files. By selecting
% desired options, the output is customized to the particular requirements
% needed.
% The file has been assembled from Oren Patashnik's standard files {\tt
% plain.bst} and {\tt unsrt.bst}, plus his non-standard file {\tt
% apalike.bst}. This last is an author-year citation style, although
% somewhat imperfect. I have added a number of other options and codings to
% produce the features that I deem necessary.
% \section{About Master Bibliographic Style Files}
% \subsection{The {\tt docstrip} Options}
% This master file is a \btx{} bibliographic style file containing
% alternative coding depending on {\tt docstrip} options. The options are
% selected when {\tt docstrip} is run, either interactively or through a
% batch job.
% Suppose that one of the options is called {\tt xyz}. Then the following
% alternatives are possible:
% \begin{quote}
% |%<xyz> | \em one line of coding
% \end{quote}
% {\em includes\/} the single line of coding;
% \begin{quote}
% |%<!xyz> | \em one line of coding
% \end{quote}
% {\em excludes\/} the single line;
% \begin{quote}
% |%<*xyz> | \\
% {\em several lines of coding}\\
% |%</xyz> |
% \end{quote}
% {\em includes\/} all the bracketted lines;
% \begin{quote}
% |%<*!xyz> | \\
% {\em several lines of coding}\\
% |%</!xyz> |
% \end{quote}
% {\em excludes\/} all the bracketted lines.
% Options may be logically combined: the symbol \verb!|! is a logical {\sf
% or}, |&| a logical {\sf and}, |!| a logical {\sf not}; parentheses {\tt(}
% and {\tt)} may be used to group options.
% \subsection{The {\tt docstrip} Batch Job}
% In order to generate a true \btx{} style file with selected options from
% this master file, it is necessary to run a {\tt docstrip} batch job.
% Suppose that the master file is named {\tt master.mbs}, and the
% resulting \btx{} style file is to be {\tt silly.bst}, and the batch job
% file itself is called {\tt silly.drv}. To produce this with options, say,
% {\tt xyz} and {\tt abc}, the batch job would look something like:
% \begin{quote}\begin{verbatim}
% \def\batchfile{silly.drv}
% \input docstrip
% \preamble
% This is for Journal of Silly Results
% \endpreamble
% \postamble
% End of customized bst file
% \endpostamble
% \keepsilent
% \generateFile{silly.bst}{f}{\from{master.mbs}{xyz,abc}}
% \end{verbatim}
% \end{quote}
% A preamble is not necessary, although it is advisable to include some
% statement about the application of the bibliographic style. A postamble
% {\em is\/} vital, otherwise the default will add |\endinput| at the end
% of the file, something that \btx{} will not understand. The |\keepsilent|
% is optional and just suppresses {\tt docstrip} output during processing.
% \subsection{The {\tt makebst} Program}
% The program {\tt makebst} simplifies the creation of the batch job file. To
% do that, it needs information on the available options. This information
% must be stored in a special format, either in the master file itself, or
% in a file with the same root name but extension {\tt.opt}. The form of
% this format is described in the documentation on {\tt makebst}.
% In the master file, this information must be enclosed within {\tt docstrip}
% options |%<*options>| \dots |%</options>| and {\em must\/} include an
% |\endoptions| command. It may also include any number of comments.
% A sample menu in the master file to select one or none of options {\tt
% xyz} {\em or\/} {\tt zyx} would look thus:
% \begin{quote}\begin{verbatim}
% %<*options>
% \mes{Select one of these}
% \optdef{f}{xyz}{Option forword}{to do forward stuff}
% \optdef{r}{zyx}{Option reverse}{to do reverse stuff}
% \optdef{*}{}{None of the above}{}
% \getans
% \endoptions
% %</options>
% %<*!options>
% . . . . . .
% %</!options>
% \end{verbatim}
% \end{quote}
% An explanation of these commands is to be found in the documentation on
% {\tt makebst}.
% The menu information may be extracted from the master file by means of
% {\tt docstrip} and stored in a file with extension {\tt.opt}. If this
% file is missing, the program tries to read it from the master file.
% \section{The Options}
% Here I present a list of all the {\tt docstrip} options that are
% available (except for {\tt options} itself). I have tried to avoid
% conflicts with mutually exclusive options by always letting one dominate.
% For example, if {\tt a} and {\tt b} are to be mutually exclusive, then
% the three possibilities are:
% \begin{quote}\begin{tabular}{rl}
% neither & \tt\%<!a\&!b> \\
% {\tt a} only & \tt\%<a> \\
% {\tt b} only & \tt\%<!a\&b>
% \end{tabular}\end{quote}
% so that if both {\tt a} and {\tt b} have been selected, the result is as
% if only {\tt a} had been given. (If one uses {\tt makebst} to produce the
% {\tt docstrip} batch job, then it is impossible to give mutually
% exclusive options.)
% Most mutually exclusive options have the same prefix before the hyphen.
% \newenvironment{opt}{%
% \begin{list}{}{\labelwidth2cm \leftmargin2.5cm \labelsep1em \rightmargin0pt
% \def\makelabel##1{\tt ##1 \hfill}}}{\end{list}}
% {\bf Citation style:} whether or not a numerical or author-year system
% is to be used.
% \begin{opt}
% \item[--] default is numerical, standard \LaTeX, as for {\tt
% plain.bst}.\\
% |\bibitem{key}...|
% \item[cite] special for listing entire databases; the cite key is used
% as the label so it may be listed.\\
% |\bibitem[key]{key}...|
% \item[ay] for author-year style of citations. Various forms of |\bibitem|
% are provided under this option, to support different types
% of \LaTeX{} styles for interfacing with the author-year system.
% \end{opt}
% If {\tt ay} has been selected, then the type of author-year interface
% is selectable.
% \begin{opt}
% \item[--] default is the system I invented for my {\tt natbib.sty}.\\
% |\bibitem[author(year)]{key}...|
% \item[alk] for the {\tt apalike.sty} of Oren Patashnik and related
% systems\\
% |\bibitem[author, year]{key}...|
% \item[har] for the Harvard family of styles (with {\tt harvard.sty}).\\
% |\harvarditem[short]{long}{year}{key}...|
% \item[ast] for astronomy family of styles (with {\tt astron.sty}).\\
% |\bibitem[\protect\astroncite{author}{year}]{key}...|
% \item[cay] for the Chicago family of styles (with {\tt chicago.sty}).\\
% |\bibitem[\protect\citeauthoryear{long}{short}{year}]{key}...|
% \item[cn] for the ``author-date'' group of styles (with {\tt
% authordate1-4.sty})\\
% |\bibitem[\protect\citename{author, }year]{key}...|
% \end{opt}
% {\bf Sequence:} the order in which the references are listed.
% \begin{opt}
% \item[--] default is alphabetical by all authors, date, title
% \item[seq-no] (numerical only) sequence by citation order
% \item[seq-lab] (author-year) by label, date, title (means that Daly
% precedes Daly and Williams, precedes Daly et al.)
% \end{opt}
% {\bf Names formatting:} how initials and surnames are to be combined.
% \begin{opt}
% \item[--] default is full names, given names first
% \item[nm-init] initials plus surname
% \item[nm-rev] surname plus initials
% \item[nm-rev1] surname plus initials (1st name only) then initials
% plus surname
% \item[nm-rv] as {\tt nm-rev}, but initials without dots
% \end{opt}
% {\bf Number of names:} normally all names listed (in reference list)
% \begin{opt}
% \item[nmlm] limit number of names
% \item[x1...x9] (with {\tt nmlm}) maximum number of names to appear
% \item[m1...m5] (with {\tt nmlm}) minimum number before `et al' written;
% no check for consistency is taken; one {\tt x} and
% one {\tt m} number must be given, and {\tt x}$\le${\tt m}
% \end{opt}
% {\bf Names font:} in the reference list
% \begin{opt}
% \item[--] default is names in normal type face
% \item[nmft-sc] names in small caps
% \item[nmft-it] names in italics
% \item[nmft-bf] names in bold
% \end{opt}
% {\bf Block punctuation:} between logical sections (not mutually
% exclusive)
% \begin{opt}
% \item[--] default is period after each logical section, including end
% \item[blk-com] use commas, except at very end (changes `In' to `in')
% \item[blk-tit] use commas, except after a title and very end
% \item[in-col] puts a colon after `In' or `in' for edited works
% \item[fin-bare] no punctuation at the very end
% \end{opt}
% {\bf Date:} position and enclosure
% \begin{opt}
% \item[--] default is date at end, before notes; for author-year,
% date consists only of year, no month
% \item[dt-beg] date goes after authors' names (author-year only)
% \item[dt-end] date goes after any notes
% \item[yr-par] no month, year in parentheses ()
% \item[yr-brk] no month, year in brackets []
% \item[yr-col] no month, year preceded by colon and space
% \end{opt}
% {\bf Article in journal:} style of title, volume, pages
% \begin{opt}
% \item[--] default is: Title. {\it Journal}, vol(num):p1--p2
% \item[vol-bf] volume in bold
% \item[vol-it] volume in italics
% \item[vol-2bf] volume and number bold
% \item[volp-com] comma and space instead of colon: vol(num), p1--p2
% \item[jpg-1] only starting page given
% \item[jnm-x] no punctuation after journal name
% \item[tit-it] article title in italics
% \item[tit-q] article title in single quotes
% \item[tit-qq] article title in double quotes
% \item[jtit-x] no article title (applies only to journals and
% collections)
% \item[atit-u] article title capitalized as in entry, default is
% sentence capitalization (first word and words following
% colons)
% \end{opt}
% {\bf Thesis title:} formatted like a book or article
% \begin{opt}
% \item[--] default is like a book title
% \item[thtit-a] titles of PhD and Master theses formatted like articles
% \end{opt}
% {\bf Book title:} font style
% \begin{opt}
% \item[--] default is italicized
% \item[btit-rm] book title plain
% \end{opt}
% {\bf Abbreviations:} of various words, default is no abbreviations
% \begin{opt}
% \item[pp] abbreviate `page(s)' as `p.' and `pp.'
% \item[ed] abbreviate `editor(s)' as `ed.' and `eds.'
% \item[abr] abbreviate `volume', `edition', `technical report', etc.
% \end{opt}
% {\bf Editor:} alternative for {\em in edited\/} work
% \begin{opt}
% \item[--] in {\em names\/}, editors, {\em title}
% \item[edby] in {\em title\/}, edited by {\em names}
% \end{opt}
% {\bf Citation label:} what is written by the |\cite| command
% \begin{opt}
% \item[--] default is no special font
% \item[lab-it] label (names printed by |\cite|) in italics
% \item[xlab-it] extra label (letter after year) in italics
% \end{opt}
% {\bf Emphasis:} defines what `italicized' really means
% \begin{opt}
% \item[--] default is |\em| (can switch between |\it|
% and |\rm|
% \item[em-it] use |\it| instead (always italic)
% \item[em-x] no emphasis
% \end{opt}
% {\bf Special punctuation:}
% \begin{opt}
% \item[amper] use \& in place of `and'
% \item[and-xcom] no comma before last `and' of an author list
% \item[and-com] add comma before `and' even for two authors
% \item[and-x] no `and' in an author list (in list of references)
% \item[etal-it] `et al.' in italics
% \end{opt}
% \section{The Menu Information}
% Here I describe the options and menu information for this particular
% master file.
% All this menu information is nested between {\tt docstrip} guard options
% |%<*options>| \dots\ |%</options>|, and the last command is
% |\endoptions|. The rest of the file is nested between |%<*!options>|
% \dots\ |%</!options>| in order to exclude it if {\tt docstrip} is used to
% extract only the menu information.
% \subsection*{Author-year or numerical}
% The first question is whether a numerical or author-year citation style
% is to be used. If the latter, the supporting system is my {\tt
% natbib.sty}, which expects |\bibitem| to have an optional argument
% containing the short form of the authors, plus year in parentheses.
% E.g.,
% \begin{quote}
% |\bibitem[Daly et al.(1990)]{key}...|
% \end{quote}
% Other systems are also supported, such as the Harvard family of
% bibliography styles (with {\tt harvard.sty}), which have entries in the
% form
% \begin{quote}
% |\harvarditem[Daly et al.]{Daly, Keppler,|\\
% | and Williams}{1990}{key}...|
% \end{quote}
% or the astronomy family (with {\tt astron.sty}) with entries like
% \begin{quote}
% |\bibitem[\protect\astroncite{Daly et al.}{1990}]{key}...|
% \end{quote}
% or the Chicago family (with {\tt chicago.sty}) with entries like
% \begin{quote}
% |\bibitem[\protect\citeautheryear{Daly, Keppler, and|\\
% | Williams}{Daly et al.}{1990}]{key}...|
% \end{quote}
% or the so-called ``author-date'' group (with {\tt authordate1-4.sty})
% with entries of the form
% \begin{quote}
% |\bibitem[\protect\citename{Daly et al.}1990]{key}...|
% \end{quote}
% Finally, there is the {\tt apalike} format of Oren Patashnik, for use
% with {\tt apalike.sty} that has entries of the form
% \begin{quote}
% |\bibitem[Daly et al., 1990]{key}...|
% \end{quote}
% In addition to numerical or author-year citation styles, there is also a
% {\tt cite} style available in which the label is the same as the cite
% key. This is for listing entire contents of databases with the cite key
% visible.
% A flag |\ifnumerical| is established because some of the following menu
% features depend on which system is to be used.
% \begin{macrocode}
%<*options>
\newif\ifnumerical \numericalfalse
\mes{^^JSTYLE OF CITATIONS:}
\optdef{*}{}{Numerical}{as in standard LaTeX}
\optdef{a}{ay}{Author-year}{with some non-standard interface}
\optdef{c}{cite}{Cite key}{(special for listing contents of bib file)}
\getans
\numericaltrue
\if\ans a\numericalfalse\fi
\ifnumerical\else
\mes{^^JAUTHOR-YEAR SUPPORT SYSTEM:}
\optdef{*}{}{Natbib}{for use with natbib.sty}
\optdef{l}{alk}{Apalike}{for use with apalike.sty}
\optdef{h}{har}{Harvard}{system with harvard.sty}
\optdef{a}{ast}{Astronomy}{system with astron.sty}
\optdef{c}{cay}{Chicago}{system with chicago.sty}
\optdef{d}{cn}{Author-date}{system with authordate1-4.sty}
\getans\fi
% \end{macrocode}
% \subsection*{Ordering of the listed references}
% Choices here depend on citation style. The default in both cases is
% alphabetical order of all authors. For numerical style, one may also
% choose an unsorted order, which means the order the same as the original
% citations. This corresponds to {\tt unsrt.bst}.
% For author-year, the second choice is by label. (The label is the
% optional |\bibitem| argument, and is what is printed in place of the
% |\cite| command.) With this option, all the papers with the same first
% author are ordered so that the one-author papers come first, followed by
% the two-author papers, followed by the multiple-author papers. This is a
% more sensible system for author-year citations, and is demanded by some
% journals (like JGR).
% \begin{macrocode}
\ifnumerical
\mes{^^JORDERING OF REFERENCES:}
\optdef{*}{}{Alphabetical}{by all authors}
\optdef{c}{seq-no}{Citation order}{(unsorted, like unsrt.bst)}
\getans
\else
\mes{^^JORDERING OF REFERENCES:}
\optdef{*}{}{Alphabetical}{by all authors}
\optdef{l}{seq-lab}{By label}%
{(Jones before Jones and James before Jones et al)}
\getans
% \end{macrocode}
% \subsection*{Formatting author names}
% The default is that the full names of the authors are listed, given names
% first, unabbreviated. Of course, if only the initials have been given in
% the {\tt.bib} file, then that is all that can appear in the list. Other
% possibilities are to use initials (even if full names in the {\tt.bib}
% file) either before or after the surnames. A specialty of the journals of
% the American Geophysical Union is to have only the first name with
% reversed initials.
% \begin{macrocode}
\mes{^^JAUTHOR NAMES:}
\optdef{*}{}{Full, surname last}{(John Frederick Smith)}
\optdef{i}{nm-init}{Initials + surname}{(J. J. Smith)}
\optdef{r}{nm-rev}{Surname + initials}{(Smith, J. J.)}
\optdef{s}{nm-rv}{Surname + dotless initials}{(Smith JJ)}
\optdef{a}{nm-rev1}{Only first name reversed}%
{(AGU style: Smith, J. J., H. K. Jones)}
\getans
% \end{macrocode}
% \subsection*{Number of authors}
% Normally the complete list of authors as given in the {\tt.bib} file are
% presented in the reference list. However, some journals prefer to limit
% them to a maximum. If there are more than this maximum number of author
% names, then a minimum number plus `et al.' are listed.
% Because no test for consistency of the numbers is carried out in the
% {\tt.bst} file itself (it might be possible, but I found it too complex),
% this is done here.
% \begin{macrocode}
\mes{^^JNUMBER OF AUTHORS:}
\optdef{*}{}{All authors}{included in listing}
\optdef{l}{nmlm}{Limited authors}{(et al replaces missing names)}
\getans
\if\ans l
\loop
\ask{\num}{Maximum number of authors (1-9)}
\ifnum\num>9
\mes{*** Must be between 1 and 9}
\repeat
\wr{\spsp\spsp\sep x\num\pc: Maximum of \num\space authors}
\mes{\spsp You have selected maximum \num\space authors}
\ifnum\num>5\def\numx{5}\else\edef\numx{\num}\fi
\loop
\ask{\num}{Minimum number (before et al given) (1-\numx)}
\ifnum\num>\numx
\mes{*** Must be between 1 and \numx}
\repeat
\wr{\spsp\spsp\sep m\num\pc: Minimum of \num\space authors}
\mes{\spsp You have selected minimum \num\space authors}
% \end{macrocode}
% \subsection*{Type face of names}
% The author names in the list of references normally appear in the current
% type face. This may be changed to small caps, bold, or italics.
% \begin{macrocode}
\mes{^^JTYPEFACE FOR AUTHORS:}
\optdef{*}{}{Normal font for authors}{}
\optdef{s}{nmft-sc}{Small caps authors}{(\string\sc)}
\optdef{i}{nmft-it}{Italic authors}{(\string\it\space or \string\em)}
\optdef{b}{nmft-bf}{Bold authors}{(\string\bf)}
\getans
% \end{macrocode}
% \subsection*{Position of date}
% This applies to author-year style only. It makes sense to put the date
% immediately after the author list, since the two items (author and year)
% are the identifiers of the reference. Default position is at the
% end of the references, before any notes. It is also possible to place
% it even after the notes.
% \begin{macrocode}
\ifnumerical\else
\mes{^^JDATE POSITION:}
\optdef{*}{}{Date at end}{}
\optdef{b}{dt-beg}{Date after authors}{}
\optdef{e}{dt-end}{Date at very end}{after any notes}
\getans
% \end{macrocode}
% \subsection*{Format of date}
% The year may be enclosed in parentheses, brackets, or preceded by a
% colon. If none of these are selected, the date (month plus year) appears.
% For author-year, the date always consists only of the year, no month.
% \begin{macrocode}
\mes{^^JDATE FORMAT:}
\ifnumerical
\optdef{*}{}{Month and year}{without any brackets}
\else
\optdef{*}{}{Year plain}{without any brackets}
\optdef{p}{yr-par}{Year in parentheses}{no month, as (1993)}
\optdef{b}{yr-brk}{Year in brackets}{no month, as [1993]}
\optdef{c}{yr-col}{Year preceded by colon}{no month, as : 1993}
\getans
% \end{macrocode}
% \subsection*{Article title in journal}
% The title of an article in a journal or in a collection (a book, or
% conference proceedings) may appear plain, in italics, within single
% or double quotes.
% Furthermore, it may have sentence capitalization (first
% word and word following colon) or be capitalized as in the {\tt.bib} file
% entry. That is why it is recommended to capitalize the entry text as it
% should appear when fully capitalized, putting words that are always
% capitalized in braces. Example:
% \begin{quote}
% |TITLE="The Results of the {Giotto} Mission"|
% \end{quote}
% which produces either ``The results of the Giotto mission'' or ``The
% Results of the Giotto Mission'', depending on option.
% Additionally, the article titles may be fully suppressed.
% \begin{macrocode}
\mes{^^JTITLE OF ARTICLE:}
\optdef{*}{}{Title plain}{with no special font}
\optdef{i}{tit-it}{Title italic}{(\string\em)}
\optdef{q}{tit-q}{Title in single quotes}{(`Title')}
\optdef{d}{tit-qq}{Title in double quotes}{(``Title'')}
\getans
\mes{^^JCAPITALIZATION OF ARTICLE TITLE:}
\optdef{*}{}{First and important words}{in capitals}
\optdef{u}{atit-u}{Capitalized}{as in bib entry}
\getans
\mes{^^JARTICLE TITLE PRESENT:}
\optdef{*}{}{Article title present}{in journals and proceedings}
\optdef{x}{jtit-x}{No article title}{}
\getans
% \end{macrocode}
% \subsection*{Title of Theses}
% The title of a these (PhD or Master's) is normally treated the same
% as that of a book. Optionally, it may be formatted like that of
% an article.
% \begin{macrocode}
\mes{^^JTHESIS TITLE:}
\optdef{*}{}{Thesis titles like books}{}
\optdef{a}{thtit-a}{Thesis title like article}{}
\getans
% \end{macrocode}
% \subsection*{Journal reference}
% Great diversity of opinion exists as to how a journal reference is to be
% formatted. It consists of a volume, possibly a number, and page limits.
% The number is really only necessary if the page numbers within one volume
% start at 1 for each physical `number'. Since journals are often bound
% together in one volume later, it makes more sense to number the pages
% continuously through the whole volume. However, this is not always so,
% and then the `number' is necessary for the full specification.
% A number of styles for journal specifications are
% \begin{quote}
% 21(2):33--55\\
% {\bf 21}(2):33--55\\
% {\it 21}(2), 33--55
% \end{quote}
% Here both start and stop page numbers have been given; often only the
% start page is wanted.
% Finally, it is possible to decide whether the journal name should be
% separated from the following specifications with a blank or comma.
% \begin{macrocode}
\mes{^^JJOURNAL VOLUME NUMBER:}
\optdef{*}{}{Volume plain}{as vol(num)}
\optdef{i}{vol-it}{Volume italic}{as {\string\em\space vol}(num)}
\optdef{b}{vol-bf}{Volume bold}{as {\string\bf\space vol}(num)}
\optdef{d}{vol-2bf}{Volume and number bold}{as {\string\bf\space vol(num)}}
\getans
\mes{^^JVOLUME PUNCTUATION:}
\optdef{*}{}{Volume with colon}{as vol(num):}
\optdef{c}{volp-com}{Volume with comma}{as vol(num),}
\getans
\mes{^^JPAGE NUMBERS:}
\optdef{*}{}{Start and stop page numbers}{given}
\optdef{f}{jpg-1}{Only start page number}{}
\getans
\mes{^^JJOURNAL NAME PUNCTUATION:}
\optdef{*}{}{Comma after journal}{name}
\optdef{x}{jnm-x}{Space after journal}{name}
\getans
% \end{macrocode}
% \subsection*{Book title}
% The title of a book (as opposed to an article in a book or journal) is
% normally italicized. This may be set to the regular font.
% \begin{macrocode}
\mes{^^JBOOK TITLE:}
\optdef{*}{}{Book title italic}{(\string\em)}
\optdef{p}{btit-rm}{Book title plain}{(no font command)}
\getans
% \end{macrocode}
% \subsection*{Edited by}
% For an article within an edited collection, the normal form is
% \begin{quote}
% In J. K. James, editor, {\em Title of Collection} \dots
% \end{quote}
% An alternative is the form
% \begin{quote}
% In {\em Title of Collection}, edited by J. K. James \dots
% \end{quote}
% \begin{macrocode}
\mes{^^JEDITOR STYLE:}
\optdef{*}{}{Word editor}{after name of editor}
\optdef{b}{edby}{Edited by}{before name of editor}
\getans
% \end{macrocode}
% \subsection*{Block punctuation}
% Blocks are logical sections of the reference specification, such as the
% author block, the journal block, editor block, etc. These are normally
% separated by periods, but alternatively a comma may be used. Another
% choice is to use commas except after titles where a period is given.
% \begin{macrocode}
\mes{^^JPUNCTUATION BETWEEN SECTIONS (BLOCKS):}
\optdef{*}{}{Period after blocks}{of authors, title, etc}
\optdef{c}{blk-com}{Comma after blocks}{}
\optdef{t}{blk-tit}{Only titles with period}{but other blocks commas}
\getans
% \end{macrocode}
% \subsection*{`In' with colon}
% When referring to works in a collection, one begins the block describing
% that collection with `In'. Optionally, one may add a colon.
% \begin{macrocode}
\mes{^^JPUNCTUATION AFTER `IN':}
\optdef{*}{}{Space after `in'}{for editted works or proceedings}
\optdef{c}{in-col}{Colon after `in'}{(as `In: ...')}
\getans
% \end{macrocode}
% \subsection*{Final punctuation}
% The punctuation at the end of the reference is normally a period. This
% may be suppressed.
% \begin{macrocode}
\mes{^^JFINAL PUNCTUATION:}
\optdef{*}{}{Period at very end}{of the listed reference}
\optdef{x}{fin-bare}{No period at end}{}
\getans
% \end{macrocode}
% \subsection*{Abbreviations}
% A number of words may be abbreviated: pages, editors, volume, chapter,
% and so on. The first two may be independently set to abbreviation, the
% rest with a single option.
% \begin{macrocode}
\mes{^^JABBREVIATE WORD `PAGES':}
\optdef{*}{}{`Page(s)'}{(no abbreviation)}
\optdef{a}{pp}{`Page' abbreviated}{as p. or pp.}
\getans
\mes{^^JABBREVIATE WORD `EDITORS':}
\optdef{*}{}{`Editor(s)'}{(no abbreviation)}
\optdef{a}{ed}{`Editor' abbreviated}{as ed. or eds.}
\getans
\mes{^^JOTHER ABBREVIATIONS:}
\optdef{*}{}{No abbreviations}{of volume, edition, chapter, etc}
\optdef{a}{abr}{Abbreviations}{of such words}
\getans
% \end{macrocode}
% \subsection*{Citation label}
% This applies to author-year style only. The label is the text written
% by the |\cite| command, and for author-year style, this is something like
% `Daly et al.\ (1990b)'. One may select italics for the authors and for the
% extra label attached to the year. The year always remains plain.
% It is not possible to select the type of brackets for the year, since
% this is determined by the \LaTeX{} style option that manages the
% author-year citations. This is not standard \LaTeX, so that there are a
% number of private style files for achieving this.
% \begin{macrocode}
\ifnumerical\else
\mes{^^JFONT OF CITATION LABEL:}
\optdef{*}{}{Cited authors plain}{as result of \string\cite\space command}
\optdef{i}{lab-it}{Cited authors italic}{}
\getans
\mes{^^JFONT OF EXTRA LABEL:^^J(The extra letter on the year)}
\optdef{*}{}{Extra label plain}{}
\optdef{i}{xlab-it}{Extra label italic}{}
\getans
% \end{macrocode}
% \subsection*{Variations on `and'}
% It is possible to replace the word `and' with an ampersand \&, and to
% specify whether a comma is to precede `and' in a list of more than two
% names.
% \begin{macrocode}
\mes{^^JAMPERSAND:}
\optdef{*}{}{Use word `and'}{in author lists}
\optdef{a}{amper}{Use ampersand}{in place of `and'}
\getans
\mes{^^JCOMMA BEFORE `AND':}
\optdef{*}{}{Comma before `and'}{as `Tom, Dick, and Harry'}
\optdef{n}{and-xcom}{No comma before `and'}{as `Tom, Dick and Harry'}
\optdef{c}{and-com}{Comma with 2 authors}{as `Tom, and Harry'}
\optdef{x}{and-x}{No `and'}{as `Tom, Dick, Harry'}
\getans
% \end{macrocode}
% \subsection*{Font of `et al'}
% One can chose that `et al.'\ be put into italics.
% \begin{macrocode}
\mes{^^JFONT OF `ET AL':}
\optdef{*}{}{Plain et al}{}
\optdef{i}{etal-it}{Italic et al}{}
\getans
% \end{macrocode}
% \subsection*{Define emphasis}
% In everything that been mentioned so far, italicization should be
% understood to mean `emphasize' in the \LaTeX{} sense. This means that the
% command |\em| is used. This is not the same as |\it|, which is always
% italics. Rather, with |\em|, the font style switches between |\rm| and
% |\it| depending on the context. Here one may choose to true italics, or
% to switch off italics altogether.
% \begin{macrocode}
\mes{^^JEMPHASIS:^^J(affects all so-called italics)}
\optdef{*}{}{Use emphasis}{ie, \string\em, allows font switching}
\optdef{i}{em-it}{Use true italics}{ie, \string\it, absolute italics}
\optdef{x}{em-x}{No italics}{at all}
\getans
\endoptions
%</options>
% \end{macrocode}
% \StopEventually{\relax
% \DeleteShortVerb{\|}
% \end{document}}
% \section{The Bibliographic Coding}
% \begin{macrocode}
%<*!options>
%%---------------------------------------------------------------------
%<*ay>
% This is an author-year citation style bibliography. As such, it is
% non-standard LaTeX, and requires a style option to function properly.
%<*alk>
% An appropriate style option is: apalike.sty by Oren Patashnik
% The form of the \bibitem entries is
% \bibitem[Jones et al., 1990]{key}...
% The \cite command functions as in standard LaTeX
% \cite{key} ==>> (Jones et al., 1990)
% \cite[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2)
% There is no way to generate textual citations.
%</alk>
%<*!(har|ast|alk|cay|cn)>
% An appropriate style option is: natbib.sty by Patrick W. Daly
% The form of the \bibitem entries is
% \bibitem[Jones et al.(1990)]{key}...
% The essential feature is that the label (the part in brackets) consists
% of the author names, as they should appear in the citation, with the year
% in parentheses following. There must be no space before the opening
% parenthesis!
% In natbib.sty, it is possible to define the type of enclosures that is
% really wanted (brackets or parentheses), but in either case, there must
% be parentheses in the label.
% The \cite command functions as follows:
% \cite{key} ==>> Jones et al. (1990)
% \cite[]{key} ==>> (Jones et al., 1990)
% \cite[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2)
%</!(har|ast|alk|cay|cn)>
%<*har>
% The appropriate style file is: harvard.sty
% The form of the bibitem entries is
% \harvarditem[Jones et al.]{Jones, Baker, and Smith}{1990}{key}...
% There are style changes that may be specified in the text with
% the command \citationstyle.
% \citeasnoun{key} ==>> Jones et al. (1990)
% \cite{key} ==>> (Jones et al. 1990)
% \cite[chap. 2]{key} ==>> (Jones et al. 1990, chap. 2)
% On the first citation of any work, the full author list is used.
%</har>
%<*cay>
% The appropriate style file is: chicago.sty
% The form of the bibitem entries is
% \bibitem[\protect\citeauthoryear{Jones, Baker, and Smith}
% {Jones et al.}{1990}{key}...
% The available citation commands are
% \cite{key} ==>> (Jones, Baker, and Smith 1990)
% \citeA{key} ==>> (Jones, Baker, and Smith)
% \citeNP{key} ==>> Jones, Baker, and Smith 1990
% \citeANP{key} ==>> Jones, Baker, and Smith
% \citeN{key} ==>> Jones, Baker, and Smith (1990)
% \shortcite ==>> (Jones et al. 1990)
% etc
% \citeyear ==>> (1990)
% \citeyearNP ==>> 1990
% Optional notes may be added where meaningful.
%</cay>
%<*ast>
% The appropriate style file is: astron.sty
% The form of the bibitem entries is
% \bibitem[\protect\astroncite{Jones et al.}{1990}]{key}...
% Usage of \cite is as follows:
% \cite{key} ==>> (Jones et al., 1990)
% \cite[chap. 2]{key} ==>> (Jones et al. 1990, chap. 2)
% \cite*{key} ==>> (1990)
%</ast>
%<*cn>
% An appropriate style file is: authordate1-4.sty
% The form of the bibitem entries is
% \bibitem[\protect\citename{Jones et al.}1990]{key}...
% Usage of \cite is as follows:
% \cite{key} ==>> (Jones et al., 1990)
% \cite[chap. 2]{key} ==>> (Jones et al. 1990, chap. 2)
% \shortcite{key} ==>> (1990)
%</cn>
%</ay>
%<*!ay>
% This is a numerical citation style, and as such is standard LaTeX.
% It requires no extra style option to interface to the main text.
% The form of the \bibitem entries is
% \bibitem{key}...
% Usage of \cite is as follows:
% \cite{key} ==>> [#]
% \cite[chap. 2]{key} ==>> [#, chap. 2]
% where # is a number determined by the ordering in the reference list.
%<*seq-no>
% This is the order in which the works were originally cited in the text.
%</seq-no>
%<*!seq-no>
% This is alphabetical by authors.
%</!seq-no>
%</!ay>
%<*!ay&cite>
% This is a special pseudo-numerical bibliography style. The form of
% the \bibitem entries is
% \bibitem[key]{key}...
% It is intended to be used to list all the entries in a bib database
%</!ay&cite>
%%---------------------------------------------------------------------
ENTRY
{ address
author
booktitle
chapter
edition
editor
howpublished
institution
journal
key
month
note
number
organization
pages
publisher
school
series
title
type
volume
year
%<!ay> { label }
%<ay&!(har|cay)> { label extra.label sort.label }
%<ay&(har|cay)> { label extra.label sort.label long.label }
INTEGERS { output.state before.all mid.sentence after.sentence after.block }
FUNCTION {init.state.consts}
{ #0 'before.all :=
#1 'mid.sentence :=
#2 'after.sentence :=
#3 'after.block :=
STRINGS { s t }
FUNCTION {output.nonnull}
{ 's :=
output.state mid.sentence =
{ ", " * write$ }
{ output.state after.block =
{ add.period$ write$
newline$
"\newblock " write$
}
{ output.state before.all =
'write$
{ add.period$ " " * write$ }
if$
}
if$
mid.sentence 'output.state :=
}
if$
FUNCTION {output}
{ duplicate$ empty$
'pop$
'output.nonnull
if$
FUNCTION {output.check}
{ 't :=
duplicate$ empty$
{ pop$ "empty " t * " in " * cite$ * warning$ }
'output.nonnull
if$
% \end{macrocode}
%\changes{1.1}{1993 Nov 12}{Test for missing year, set to ????}
% \begin{macrocode}
FUNCTION {output.bibitem}
{ newline$
%<*ay>
%<!har> "\bibitem[" write$
%<har> "\harvarditem[" write$
%<ast> "\protect\astroncite{" write$
%<cay> "\protect\citeauthoryear{" long.label * "}{" * write$
%<cn> "\protect\citename{" write$
label write$
%<har> "]{" long.label * "}{" * write$
%<har> year duplicate$ empty$
%<cn> ", }" year duplicate$ empty$
%<cay|ast> "}{" year duplicate$ empty$
%<har|cn|cay|ast> { pop$ "????" }
%<har|cn|cay|ast> 'skip$
%<har|cn|cay|ast> if$
%<har> extra.label * "}{" * write$
%<cn> * extra.label * "]{" * write$
%<cay|ast> * extra.label * "}]{" * write$
%<alk> "]{" write$
%<!(har|cay|ast|alk|cn)> ")]{" write$
%</ay>
%<!ay&!cite> "\bibitem{" write$
%<!ay&cite> "\bibitem[" label * "]{" * write$
cite$ write$
"}" write$
newline$
before.all 'output.state :=
FUNCTION {fin.entry}
%<*!fin-bare>
{ add.period$
write$
%</!fin-bare>
%<*fin-bare>
{ duplicate$ empty$
'pop$
'write$
if$
%</fin-bare>
newline$
FUNCTION {new.block}
{ output.state before.all =
'skip$
{ after.block 'output.state := }
if$
FUNCTION {new.sentence}
{ output.state after.block =
'skip$
{ output.state before.all =
'skip$
{ after.sentence 'output.state := }
if$
}
if$
FUNCTION {not}
{ { #0 }
{ #1 }
if$
FUNCTION {and}
{ 'skip$
{ pop$ #0 }
if$
FUNCTION {or}
{ { pop$ #1 }
'skip$
if$
%<*!ay>
FUNCTION {new.block.checka}
{ empty$
'skip$
'new.block
if$
%</!ay>
FUNCTION {new.block.checkb}
{ empty$
swap$ empty$
and
'skip$
'new.block
if$
%<*!ay>
FUNCTION {new.sentence.checka}
{ empty$
'skip$
'new.sentence
if$
FUNCTION {new.sentence.checkb}
{ empty$
swap$ empty$
and
'skip$
'new.sentence
if$
%</!ay>
FUNCTION {field.or.null}
{ duplicate$ empty$
{ pop$ "" }
'skip$
if$
FUNCTION {emphasize}
%<*!em-x>
{ duplicate$ empty$
{ pop$ "" }
%<!em-it> { "{\em " swap$ * "}" * }
%<em-it> { "{\it " swap$ * "}" * }
if$
%</!em-x>
%<em-x>{ skip$ }
%<*nmft-bf|vol-bf|vol-2bf>
FUNCTION {bolden}
{ duplicate$ empty$
{ pop$ "" }
{ "{\bf " swap$ * "}" * }
if$
%</nmft-bf|vol-bf|vol-2bf>
INTEGERS { nameptr namesleft numnames }
FUNCTION {format.names}
{ 's :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
%<*!nm-rev1>
{ s nameptr
%<!nm-init&!nm-rev&!nm-rv> "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
%<nm-init> "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
%<!nm-init&nm-rev> "{vv~}{ll}{, jj}{, f.}" format.name$ 't :=
%<!nm-init&!nm-rev&nm-rv> "{vv~}{ll}{ jj}{ f{~}}" format.name$ 't :=
%</!nm-rev1>
%<*nm-rev1>
{ nameptr #1 >
{ s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := }
{ s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ 't := }
if$
%</nm-rev1>
nameptr #1 >
{
%<*nmlm>
%<m1> nameptr #2 =
%<m2> nameptr #3 =
%<m3> nameptr #4 =
%<m4> nameptr #5 =
%<m5> nameptr #6 =
%<x1> numnames #1 > and
%<x2> numnames #2 > and
%<x3> numnames #3 > and
%<x4> numnames #4 > and
%<x5> numnames #5 > and
%<x6> numnames #6 > and
%<x7> numnames #7 > and
%<x8> numnames #8 > and
%<x9> numnames #9 > and
{ "others" 't :=
#1 'namesleft := }
'skip$
if$
%</nmlm>
namesleft #1 >
{ ", " * t * }
{
%<and-com|and-x> "," *
%<*!and-xcom&!and-com&!and-x>
numnames #2 >
{ "," * }
'skip$
if$
%</!and-xcom&!and-com&!and-x>
t "others" =
%<!etal-it> { " et~al." * }
%<etal-it> { " " * "et~al." emphasize * }
%<!amper&!and-x> { " and " * t * }
%<amper&!and-x> { " \& " * t * }
%<and-x&!and-com> { " " * t * }
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
FUNCTION {format.names.ed}
{ 's :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ s nameptr
%<!nm-init&!nm-rev&!nm-rev1&!nm-rv> "{ff~}{vv~}{ll}{, jj}"
%<nm-init|nm-rev|nm-rev1> "{f.~}{vv~}{ll}{, jj}"
%<!nm-init&!nm-rev&!nm-rev1&nm-rv> "{f{~}~}{vv~}{ll}{ jj}"
format.name$ 't :=
nameptr #1 >
{
namesleft #1 >
{ ", " * t * }
{
%<and-com|and-x> "," *
%<*!and-xcom&!and-com&!and-x>
numnames #2 >
{ "," * }
'skip$
if$
%</!and-xcom&!and-com&!and-x>
t "others" =
%<!etal-it> { " et~al." * }
%<etal-it> { " " * "et~al." emphasize * }
%<!amper&!and-x> { " and " * t * }
%<amper&!and-x> { " \& " * t * }
%<and-x&!and-com> { " " * t * }
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
%<*ay>
FUNCTION {format.key}
{ empty$
{ key field.or.null }
{ "" }
if$
%</ay>
FUNCTION {format.authors}
{ author empty$
{ "" }
%<!nmft-sc&!nmft-bf&!nmft-it> { author format.names }
%<nmft-sc> { "{\sc " author format.names * "}" * }
%<!nmft-sc&nmft-bf> { author format.names bolden }
%<!nmft-sc&!nmft-bf&nmft-it> { author format.names emphasize }
if$
FUNCTION {format.editors}
{ editor empty$
{ "" }
%<!nmft-sc&!nmft-bf&!nmft-it> { editor format.names
%<nmft-sc> { "{\sc " editor format.names * "}" *
%<!nmft-sc&nmft-bf> { editor format.names bolden
%<!nmft-sc&!nmft-bf&nmft-it> { editor format.names emphasize
editor num.names$ #1 >
%<!ed> { ", editors" * }
%<!ed> { ", editor" * }
%<ed> { " (eds.)" * }
%<ed> { " (ed.)" * }
if$
}
if$
FUNCTION {format.in.editors}
{ editor empty$
{ "" }
{ editor format.names.ed
%<*!edby>
editor num.names$ #1 >
%<!ed> { ", editors" * }
%<!ed> { ", editor" * }
%<ed> { " (eds.)" * }
%<ed> { " (ed.)" * }
if$
%</!edby>
}
if$
FUNCTION {format.title}
{ title empty$
{ "" }
%<!atit-u> { title "t" change.case$
%<atit-u> { title
%<tit-it> emphasize
%<!tit-it&tit-q> "`" swap$ * "'" *
%<!tit-it&!tit-q&tit-qq> "``" swap$ * "''" *
}
if$
FUNCTION {n.dashify}
{ 't :=
{ t empty$ not }
{ t #1 #1 substring$ "-" =
{ t #1 #2 substring$ "--" = not
{ "--" *
t #2 global.max$ substring$ 't :=
}
{ { t #1 #1 substring$ "-" = }
{ "-" *
t #2 global.max$ substring$ 't :=
}
while$
}
if$
}
{ t #1 #1 substring$ *
t #2 global.max$ substring$ 't :=
}
if$
}
while$
FUNCTION {word.in}
%<blk-com&in-col>{ "in: " }
%<blk-com&!in-col>{ "in " }
%<!blk-com&in-col>{ "In: " }
%<!blk-com&!in-col>{ "In " }
%<*ay>
FUNCTION {format.date}
{ year duplicate$ empty$
{ "empty year in " cite$ * "; set to ????" * warning$
pop$ "????" }
'skip$
if$
%<yr-par|yr-brk|yr-col> before.all 'output.state :=
%<yr-par> " (" swap$ * extra.label * ")" *
%<!yr-par&yr-brk> " [" swap$ * extra.label * "]" *
%<!yr-par&!yr-brk&yr-col> ": " swap$ * extra.label *
%<!yr-par&!yr-brk&!yr-col> extra.label *
%</ay>
%<*!ay>
FUNCTION {format.date}
{ year empty$
{ month empty$
{ "" }
{ "there's a month but no year in " cite$ * warning$
month
}
if$
}
{
%<yr-par|yr-brk|yr-col> before.all 'output.state :=
%<yr-par> " (" year * ")" *
%<!yr-par&yr-brk> " [" year * "]" *
%<!yr-par&!yr-brk&yr-col> ": " year *
%<*!yr-par&!yr-brk&!yr-col>
month empty$
'year
{ month " " * year * }
if$
%</!yr-par&!yr-brk&!yr-col>
}
if$
%</!ay>
FUNCTION {format.btitle}
%<!btit-rm>{ title emphasize
%<btit-rm>{ title
FUNCTION {tie.or.space.connect}
{ duplicate$ text.length$ #3 <
{ "~" }
{ " " }
if$
swap$ * *
FUNCTION {either.or.check}
{ empty$
'pop$
{ "can't use both " swap$ * " fields in " * cite$ * warning$ }
if$
FUNCTION {format.bvolume}
{ volume empty$
{ "" }
%<!abr> { "volume" volume tie.or.space.connect
%<abr> { "vol." volume tie.or.space.connect
series empty$
'skip$
{ " of " * series emphasize * }
if$
"volume and number" number either.or.check
}
if$
FUNCTION {format.number.series}
{ volume empty$
{ number empty$
{ series field.or.null }
{ output.state mid.sentence =
%<!abr> { "number" }
%<!abr> { "Number" }
%<abr> { "no." }
%<abr> { "No." }
if$
number tie.or.space.connect
series empty$
{ "there's a number but no series in " cite$ * warning$ }
{ " in " * series * }
if$
}
if$
}
{ "" }
if$
FUNCTION {format.edition}
{ edition empty$
{ "" }
{ output.state mid.sentence =
%<!abr> { edition "l" change.case$ " edition" * }
%<!abr> { edition "t" change.case$ " edition" * }
%<abr> { edition "l" change.case$ " edn." * }
%<abr> { edition "t" change.case$ " edn." * }
if$
}
if$
INTEGERS { multiresult }
FUNCTION {multi.page.check}
{ 't :=
#0 'multiresult :=
{ multiresult not
t empty$ not
and
}
{ t #1 #1 substring$
duplicate$ "-" =
swap$ duplicate$ "," =
swap$ "+" =
or or
{ #1 'multiresult := }
{ t #2 global.max$ substring$ 't := }
if$
}
while$
multiresult
FUNCTION {format.pages}
{ pages empty$
{ "" }
{ pages multi.page.check
%<!pp> { "pages" pages n.dashify tie.or.space.connect }
%<!pp> { "page" pages tie.or.space.connect }
%<pp> { "pp." pages n.dashify tie.or.space.connect }
%<pp> { "p." pages tie.or.space.connect }
if$
}
if$
%<*jpg-1|pg-1>
FUNCTION {first.page}
{ 't :=
{ t empty$ not t #1 #1 substring$ "-" = not and }
{ t #1 #1 substring$ *
t #2 global.max$ substring$ 't :=
}
while$
%</jpg-1|pg-1>
FUNCTION {format.vol.num.pages}
{ volume field.or.null
%<vol-bf&!vol-2bf> bolden
%<!vol-bf&!vol-2bf&vol-it> emphasize
number empty$
'skip$
{ "(" number * ")" * *
%<!vol-bf&vol-2bf> bolden
volume empty$
{ "there's a number but no volume in " cite$ * warning$ }
'skip$
if$
}
if$
pages empty$
'skip$
{ duplicate$ empty$
{ pop$ format.pages }
%<!volp-com&!jpg-1> { ":" * pages n.dashify * }
%<volp-com&!jpg-1> { ", " * pages n.dashify * }
%<!volp-com&jpg-1> { ":" * pages first.page * }
%<volp-com&jpg-1> { ", " * pages first.page * }
if$
}
if$
FUNCTION {format.chapter.pages}
{ chapter empty$
'format.pages
{ type empty$
%<!abr> { "chapter" }
%<abr> { "chap." }
{ type "l" change.case$ }
if$
chapter tie.or.space.connect
pages empty$
'skip$
{ ", " * format.pages * }
if$
}
if$
FUNCTION {format.in.ed.booktitle}
{ booktitle empty$
{ "" }
{ editor empty$
{ word.in booktitle emphasize * }
%<!edby> { word.in format.in.editors * ", " * booktitle emphasize * }
%<edby> { word.in booktitle emphasize * ", edited by " *
%<edby> format.in.editors * }
if$
}
if$
%<*!ay>
FUNCTION {empty.misc.check}
{ author empty$ title empty$ howpublished empty$
month empty$ year empty$ note empty$
and and and and and
key empty$ not and
{ "all relevant fields are empty in " cite$ * warning$ }
'skip$
if$
%</!ay>
FUNCTION {format.thesis.type}
{ type empty$
'skip$
{ pop$
type "t" change.case$
}
if$
FUNCTION {format.tr.number}
{ type empty$
%<!abr> { "Technical Report" }
%<abr> { "Tech. Rep." }
'type
if$
number empty$
{ "t" change.case$ }
{ number tie.or.space.connect }
if$
FUNCTION {format.article.crossref}
%<*!ay>
key empty$
{ journal empty$
{ "need key or journal for " cite$ * " to crossref " * crossref *
warning$
""
}
{ word.in "{\em " * journal * "\/} " * }
if$
}
{ word.in key * " " *}
if$
%</!ay>
%<ay> word.in
"\cite{" * crossref * "}" *
%<*!ay>
FUNCTION {format.crossref.editor}
{ editor #1 "{vv~}{ll}" format.name$
editor num.names$ duplicate$
#2 >
%<!etal-it> { pop$ " et~al." * }
%<etal-it> { pop$ " " * "et~al." emphasize * }
{ #2 <
'skip$
{ editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
%<!etal-it> { " et~al." * }
%<etal-it> { " " * "et~al." emphasize * }
%<!amper> { " and " * editor #2 "{vv~}{ll}" format.name$ * }
%<amper> { " \& " * editor #2 "{vv~}{ll}" format.name$ * }
if$
}
if$
}
if$
%</!ay>
FUNCTION {format.book.crossref}
{ volume empty$
{ "empty volume in " cite$ * "'s crossref of " * crossref * warning$
word.in
}
%<!abr&!(blk-com|blk-tit)> { "Volume" volume tie.or.space.connect
%<abr&!(blk-com|blk-tit)> { "Vol." volume tie.or.space.connect
%<!abr&(blk-com|blk-tit)> { "volume" volume tie.or.space.connect
%<abr&(blk-com|blk-tit)> { "vol." volume tie.or.space.connect
" of " *
}
if$
%<*!ay>
editor empty$
editor field.or.null author field.or.null =
{ key empty$
{ series empty$
{ "need editor, key, or series for " cite$ * " to crossref " *
crossref * warning$
"" *
}
{ "{\em " * series * "\/}" * }
if$
}
{ key * }
if$
}
{ format.crossref.editor * }
if$
%</!ay>
"\cite{" * crossref * "}" *
FUNCTION {format.incoll.inproc.crossref}
%<*!ay>
editor empty$
editor field.or.null author field.or.null =
{ key empty$
{ booktitle empty$
{ "need editor, key, or booktitle for " cite$ * " to crossref " *
crossref * warning$
""
}
{ word.in "{\em " * booktitle * "\/} " * }
if$
}
{ word.in key * " " *}
if$
}
{ word.in format.crossref.editor * " " *}
if$
%</!ay>
%<ay> word.in
"\cite{" * crossref * "}" *
FUNCTION {article}
{ output.bibitem
format.authors "author" output.check
%<ay> author format.key output
%<dt-beg> format.date "year" output.check
%<!blk-com&!blk-tit> new.block
%<!jtit-x> format.title "title" output.check
%<!blk-com&!blk-tit> new.block
%<blk-tit> new.sentence
crossref missing$
{ journal emphasize "journal" output.check
%<jnm-x> " " * before.all 'output.state :=
format.vol.num.pages output
%<!dt-beg&!dt-end> format.date "year" output.check
}
{ format.article.crossref output.nonnull
format.pages output
}
if$
%<!blk-com&!blk-tit> new.block
note output
%<*!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date "year" output.check
%</!dt-beg&dt-end>
fin.entry
FUNCTION {book}
{ output.bibitem
author empty$
{ format.editors "author and editor" output.check
%<ay> editor format.key output
}
{ format.authors output.nonnull
crossref missing$
{ "author and editor" editor either.or.check }
'skip$
if$
}
if$
%<dt-beg> format.date "year" output.check
%<!blk-com&!blk-tit> new.block
format.btitle "title" output.check
crossref missing$
{ format.bvolume output
%<!blk-com&!blk-tit> new.block
%<blk-tit> new.sentence
format.number.series output
new.sentence
publisher "publisher" output.check
address output
}
{
%<!blk-com&!blk-tit> new.block
%<blk-tit> new.sentence
format.book.crossref output.nonnull
}
if$
format.edition output
%<!dt-beg&!dt-end> format.date "year" output.check
%<!blk-com&!blk-tit> new.block
note output
%<*!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date "year" output.check
%</!dt-beg&dt-end>
fin.entry
FUNCTION {booklet}
{ output.bibitem
format.authors output
%<ay> author format.key output
%<ay&dt-beg> format.date "year" output.check
%<!ay&dt-beg> format.date output
%<!blk-com&!blk-tit> new.block
format.title "title" output.check
%<!blk-com&!blk-tit> new.block
%<blk-tit> new.sentence
howpublished output
address output
%<ay&!dt-beg&!dt-end> format.date "year" output.check
%<!ay&!dt-beg&!dt-end> format.date output
%<!blk-com&!blk-tit> new.block
note output
%<*ay&!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date "year" output.check
%</ay&!dt-beg&dt-end>
%<*!ay&!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date output
%</!ay&!dt-beg&dt-end>
fin.entry
FUNCTION {inbook}
{ output.bibitem
author empty$
{ format.editors "author and editor" output.check
%<ay> editor format.key output
}
{ format.authors output.nonnull
crossref missing$
{ "author and editor" editor either.or.check }
'skip$
if$
}
if$
%<dt-beg> format.date "year" output.check
%<!blk-com&!blk-tit> new.block
format.btitle "title" output.check
crossref missing$
{ format.bvolume output
format.chapter.pages "chapter and pages" output.check
%<!blk-com&!blk-tit> new.block
%<blk-tit> new.sentence
format.number.series output
new.sentence
publisher "publisher" output.check
address output
}
{ format.chapter.pages "chapter and pages" output.check
%<!blk-com&!blk-tit> new.block
%<blk-tit> new.sentence
format.book.crossref output.nonnull
}
if$
format.edition output
%<!dt-beg&!dt-end> format.date "year" output.check
%<!blk-com&!blk-tit> new.block
note output
%<*!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date "year" output.check
%</!dt-beg&dt-end>
fin.entry
FUNCTION {incollection}
{ output.bibitem
format.authors "author" output.check
%<ay> author format.key output
%<dt-beg> format.date "year" output.check
%<!blk-com&!blk-tit> new.block
%<!jtit-x> format.title "title" output.check
%<!blk-com&!blk-tit> new.block
%<blk-tit> new.sentence
crossref missing$
{ format.in.ed.booktitle "booktitle" output.check
format.bvolume output
format.number.series output
format.chapter.pages output
new.sentence
publisher "publisher" output.check
address output
format.edition output
%<!dt-beg&!dt-end> format.date "year" output.check
}
{ format.incoll.inproc.crossref output.nonnull
format.chapter.pages output
}
if$
%<!blk-com&!blk-tit> new.block
note output
%<*!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date "year" output.check
%</!dt-beg&dt-end>
fin.entry
FUNCTION {inproceedings}
{ output.bibitem
format.authors "author" output.check
%<ay> author format.key output
%<dt-beg> format.date "year" output.check
%<!blk-com&!blk-tit> new.block
%<!jtit-x> format.title "title" output.check
%<!blk-com&!blk-tit> new.block
%<blk-tit> new.sentence
crossref missing$
{ format.in.ed.booktitle "booktitle" output.check
format.bvolume output
format.number.series output
format.pages output
%<*!ay>
address empty$
{ organization publisher new.sentence.checkb
organization output
publisher output
format.date "year" output.check
}
{ address output.nonnull
%<!dt-beg&!dt-end> format.date "year" output.check
new.sentence
organization output
publisher output
}
if$
%</!ay>
%<*ay>
address output
new.sentence
organization output
publisher output
%<!dt-beg&!dt-end> format.date "year" output.check
%</ay>
}
{ format.incoll.inproc.crossref output.nonnull
format.pages output
}
if$
%<!blk-com&!blk-tit> new.block
note output
%<*!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date "year" output.check
%</!dt-beg&dt-end>
fin.entry
FUNCTION {conference} { inproceedings }
%<*ay>
FUNCTION {manual}
{ output.bibitem
format.authors output
author format.key output
%<dt-beg> format.date "year" output.check
%<!blk-com&!blk-tit> new.block
format.btitle "title" output.check
%<blk-tit> new.sentence
%<!blk-com&!blk-tit> organization address new.block.checkb
organization output
address output
format.edition output
%<!dt-beg&!dt-end> format.date "year" output.check
%<!blk-com&!blk-tit> new.block
note output
%<*!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date "year" output.check
%</!dt-beg&dt-end>
fin.entry
%</ay>
%<*!ay>
FUNCTION {manual}
{ output.bibitem
author empty$
{ organization empty$
'skip$
{ organization output.nonnull
address output
}
if$
}
{ format.authors output.nonnull }
if$
%<ay&dt-beg> format.date "year" output.check
%<!ay&dt-beg> format.date output
%<!blk-com&!blk-tit> new.block
format.btitle "title" output.check
%<blk-tit> new.sentence
author empty$
{ organization empty$
{
%<!blk-com&!blk-tit> address new.block.checka
address output
}
'skip$
if$
}
{
%<!blk-com&!blk-tit> organization address new.block.checkb
organization output
address output
}
if$
format.edition output
%<ay&!dt-beg&!dt-end> format.date "year" output.check
%<!ay&!dt-beg&!dt-end> format.date output
%<!blk-com&!blk-tit> new.block
note output
%<*ay&!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date "year" output.check
%</ay&!dt-beg&dt-end>
%<*!ay&!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date output
%</!ay&!dt-beg&dt-end>
fin.entry
%</!ay>
FUNCTION {mastersthesis}
{ output.bibitem
format.authors "author" output.check
%<ay> author format.key output
%<dt-beg> format.date "year" output.check
%<!blk-com&!blk-tit> new.block
%<!thtit-a> format.btitle "title" output.check
%<thtit-a> format.title "title" output.check
%<!blk-com&!blk-tit> new.block
%<blk-tit> new.sentence
"Master's thesis" format.thesis.type output.nonnull
school "school" output.check
address output
%<!dt-beg&!dt-end> format.date "year" output.check
%<!blk-com&!blk-tit> new.block
note output
%<*!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date "year" output.check
%</!dt-beg&dt-end>
fin.entry
FUNCTION {misc}
{ output.bibitem
format.authors output
%<ay> author format.key output
%<ay&dt-beg> format.date "year" output.check
%<!ay&dt-beg> format.date output
%<*ay>
%<!blk-com&!blk-tit> new.block
format.title output
%<!blk-com&!blk-tit> new.block
%<blk-tit> new.sentence
%</ay>
%<*!ay>
%<!blk-com&!blk-tit> title howpublished new.block.checkb
format.title output
%<blk-tit> new.sentence
%<!blk-com&!blk-tit> howpublished new.block.checka
%</!ay>
howpublished output
%<ay&!dt-beg&!dt-end> format.date "year" output.check
%<!ay&!dt-beg&!dt-end> format.date output
%<!blk-com&!blk-tit> new.block
note output
%<*ay&!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date "year" output.check
%</ay&!dt-beg&dt-end>
%<*!ay&!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date output
%</!ay&!dt-beg&dt-end>
fin.entry
FUNCTION {phdthesis}
{ output.bibitem
format.authors "author" output.check
%<ay> author format.key output
%<dt-beg> format.date "year" output.check
%<!blk-com&!blk-tit> new.block
%<!thtit-a> format.btitle "title" output.check
%<thtit-a> format.title "title" output.check
%<!blk-com&!blk-tit> new.block
%<blk-tit> new.sentence
"Ph.D. thesis" format.thesis.type output.nonnull
school "school" output.check
address output
%<!dt-beg&!dt-end> format.date "year" output.check
%<!blk-com&!blk-tit> new.block
note output
%<*!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date "year" output.check
%</!dt-beg&dt-end>
fin.entry
%<*ay>
FUNCTION {proceedings}
{ output.bibitem
format.editors output
editor format.key output
%<dt-beg> format.date "year" output.check
%<!blk-com&!blk-tit> new.block
format.btitle "title" output.check
format.bvolume output
format.number.series output
address output
new.sentence
organization output
publisher output
%<!dt-beg&!dt-end> format.date "year" output.check
%<!blk-com&!blk-tit> new.block
note output
%<*!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date "year" output.check
%</!dt-beg&dt-end>
fin.entry
%</ay>
%<*!ay>
FUNCTION {proceedings}
{ output.bibitem
editor empty$
{ organization output }
{ format.editors output.nonnull }
if$
%<dt-beg> format.date "year" output.check
%<!blk-com&!blk-tit> new.block
format.btitle "title" output.check
format.bvolume output
format.number.series output
address empty$
{ editor empty$
{ publisher new.sentence.checka }
{ organization publisher new.sentence.checkb
organization output
}
if$
publisher output
%<!dt-beg&!dt-end> format.date "year" output.check
}
{ address output.nonnull
%<!dt-beg&!dt-end> format.date "year" output.check
new.sentence
editor empty$
'skip$
{ organization output }
if$
publisher output
}
if$
%<!blk-com&!blk-tit> new.block
note output
%<*!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date "year" output.check
%</!dt-beg&dt-end>
fin.entry
%</!ay>
FUNCTION {techreport}
{ output.bibitem
format.authors "author" output.check
%<ay> author format.key output
%<dt-beg> format.date "year" output.check
%<!blk-com&!blk-tit> new.block
format.title "title" output.check
%<!blk-com&!blk-tit> new.block
%<blk-tit> new.sentence
format.tr.number output.nonnull
institution "institution" output.check
address output
%<!dt-beg&!dt-end> format.date "year" output.check
%<!blk-com&!blk-tit> new.block
note output
%<*!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date "year" output.check
%</!dt-beg&dt-end>
fin.entry
FUNCTION {unpublished}
{ output.bibitem
format.authors "author" output.check
%<ay> author format.key output
%<ay&dt-beg> format.date "year" output.check
%<!ay&dt-beg> format.date output
%<!blk-com&!blk-tit> new.block
format.title "title" output.check
%<!blk-com&!blk-tit> new.block
%<blk-tit> new.sentence
note "note" output.check
%<*ay&!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date "year" output.check
%</ay&!dt-beg&dt-end>
%<*!ay&!dt-beg&dt-end>
%<!blk-com&!blk-tit> new.block
format.date output
%</!ay&!dt-beg&dt-end>
fin.entry
FUNCTION {default.type} { misc }
MACRO {jan} {"January"}
MACRO {feb} {"February"}
MACRO {mar} {"March"}
MACRO {apr} {"April"}
MACRO {may} {"May"}
MACRO {jun} {"June"}
MACRO {jul} {"July"}
MACRO {aug} {"August"}
MACRO {sep} {"September"}
MACRO {oct} {"October"}
MACRO {nov} {"November"}
MACRO {dec} {"December"}
MACRO {acmcs} {"ACM Computing Surveys"}
MACRO {acta} {"Acta Informatica"}
MACRO {cacm} {"Communications of the ACM"}
MACRO {ibmjrd} {"IBM Journal of Research and Development"}
MACRO {ibmsj} {"IBM Systems Journal"}
MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
MACRO {ieeetc} {"IEEE Transactions on Computers"}
MACRO {ieeetcad}
{"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
MACRO {ipl} {"Information Processing Letters"}
MACRO {jacm} {"Journal of the ACM"}
MACRO {jcss} {"Journal of Computer and System Sciences"}
MACRO {scp} {"Science of Computer Programming"}
MACRO {sicomp} {"SIAM Journal on Computing"}
MACRO {tocs} {"ACM Transactions on Computer Systems"}
MACRO {tods} {"ACM Transactions on Database Systems"}
MACRO {tog} {"ACM Transactions on Graphics"}
MACRO {toms} {"ACM Transactions on Mathematical Software"}
MACRO {toois} {"ACM Transactions on Office Information Systems"}
MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
MACRO {tcs} {"Theoretical Computer Science"}
%<*ay|!seq-no>
FUNCTION {sortify}
{ purify$
"l" change.case$
INTEGERS { len }
FUNCTION {chop.word}
{ 's :=
'len :=
s #1 len substring$ =
{ s len #1 + global.max$ substring$ }
's
if$
%<*ay>
FUNCTION {format.lab.names}
{ 's :=
s #1 "{vv~}{ll}" format.name$
s num.names$ duplicate$
#2 >
%<!etal-it> { pop$ " et~al." * }
%<etal-it> { pop$ " " * "et~al." emphasize * }
{ #2 <
'skip$
{ s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
%<!etal-it> { " et~al." * }
%<etal-it> { " " * "et~al." emphasize * }
%<!amper> { " and " * s #2 "{vv~}{ll}" format.name$ * }
%<amper> { " \& " * s #2 "{vv~}{ll}" format.name$ * }
if$
}
if$
}
if$
%<*har|cay>
FUNCTION {format.long.lab.names}
{ 's :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ s nameptr
"{vv~}{ll}" format.name$ 't :=
nameptr #1 >
{
%<*nmlm>
%<m1> nameptr #2 =
%<m2> nameptr #3 =
%<m3> nameptr #4 =
%<m4> nameptr #5 =
%<m5> nameptr #6 =
%<x1> numnames #1 > and
%<x2> numnames #2 > and
%<x3> numnames #3 > and
%<x4> numnames #4 > and
%<x5> numnames #5 > and
%<x6> numnames #6 > and
%<x7> numnames #7 > and
%<x8> numnames #8 > and
%<x9> numnames #9 > and
{ "others" 't :=
#1 'namesleft := }
'skip$
if$
%</nmlm>
namesleft #1 >
{ ", " * t * }
{
%<and-com> "," *
%<*!and-xcom&!and-com>
numnames #2 >
{ "," * }
'skip$
if$
%</!and-xcom&!and-com>
t "others" =
%<!etal-it> { " et~al." * }
%<etal-it> { " " * "et~al." emphasize * }
%<!amper> { " and " * t * }
%<amper> { " \& " * t * }
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
%</har|cay>
FUNCTION {author.key.label}
{ author empty$
{ key empty$
{ cite$ #1 #3 substring$ }
'key
if$
}
{ author format.lab.names }
if$
FUNCTION {author.editor.key.label}
{ author empty$
{ editor empty$
{ key empty$
{ cite$ #1 #3 substring$ }
'key
if$
}
{ editor format.lab.names }
if$
}
{ author format.lab.names }
if$
FUNCTION {editor.key.label}
{ editor empty$
{ key empty$
{ cite$ #1 #3 substring$ }
'key
if$
}
{ editor format.lab.names }
if$
FUNCTION {calc.label}
{ type$ "book" =
type$ "inbook" =
'author.editor.key.label
{ type$ "proceedings" =
'editor.key.label
'author.key.label
if$
}
if$
%<lab-it> emphasize
%<!(har|ast|cay|alk|cn)> "("
%<har|ast|cay|alk|cn> ", "
year duplicate$ empty$
{ pop$ "????" }
{ purify$ #-1 #4 substring$ }
if$
'label :=
%<*har|cay|ast|cn>
FUNCTION {calc.short.label}
{ type$ "book" =
type$ "inbook" =
'author.editor.key.label
{ type$ "proceedings" =
'editor.key.label
'author.key.label
if$
}
if$
%<lab-it> emphasize
'label :=
%</har|cay|ast|cn>
%<*har|cay>
% \end{macrocode}
% \changes{1.1}{1993 Nov 12}{Add key labels to {\tt calc.long.label} and
% get {\tt'author} and {\tt'editor} in right order when author missing}
% \begin{macrocode}
FUNCTION {calc.long.label}
{ type$ "book" =
type$ "inbook" =
{ author empty$
'editor
'author
if$
}
{ type$ "proceedings" =
'editor.key.label
'author.key.label
if$
}
if$
format.long.lab.names
%<lab-it> emphasize
'long.label :=
%</har|cay>
%</ay>
FUNCTION {sort.format.names}
{ 's :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ nameptr #1 >
{ " " * }
'skip$
if$
s nameptr
%<!nm-init&!nm-rev&!nm-rev1&!nm-rv> "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}"
%<nm-init|nm-rev|nm-rev1|nm-rv> "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}"
format.name$ 't :=
nameptr numnames = t "others" = and
{ "et al" * }
%<*seq-lab>
{ numnames #2 > nameptr #2 = and
{ "zzzzzz" * #1 'namesleft := }
{ t sortify * }
if$
}
%</seq-lab>
%<!seq-lab> { t sortify * }
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
FUNCTION {sort.format.title}
{ 't :=
"A " #2
"An " #3
"The " #4 t chop.word
chop.word
chop.word
sortify
#1 global.max$ substring$
FUNCTION {author.sort}
{ author empty$
{ key empty$
{ "to sort, need author or key in " cite$ * warning$
""
}
{ key sortify }
if$
}
{ author sort.format.names }
if$
FUNCTION {author.editor.sort}
{ author empty$
{ editor empty$
{ key empty$
{ "to sort, need author, editor, or key in " cite$ * warning$
""
}
{ key sortify }
if$
}
{ editor sort.format.names }
if$
}
{ author sort.format.names }
if$
%<*ay>
FUNCTION {editor.sort}
{ editor empty$
{ key empty$
{ "to sort, need editor or key in " cite$ * warning$
""
}
{ key sortify }
if$
}
{ editor sort.format.names }
if$
FUNCTION {presort}
{ calc.label
label sortify
" "
type$ "book" =
type$ "inbook" =
'author.editor.sort
{ type$ "proceedings" =
'editor.sort
'author.sort
if$
}
if$
#1 entry.max$ substring$
'sort.label :=
sort.label
" "
title field.or.null
sort.format.title
#1 entry.max$ substring$
'sort.key$ :=
%</ay>
%</ay|!seq-no>
%<*!ay&!seq-no>
FUNCTION {author.organization.sort}
{ author empty$
{ organization empty$
{ key empty$
{ "to sort, need author, organization, or key in " cite$ * warning$
""
}
{ key sortify }
if$
}
{ "The " #4 organization chop.word sortify }
if$
}
{ author sort.format.names }
if$
FUNCTION {editor.organization.sort}
{ editor empty$
{ organization empty$
{ key empty$
{ "to sort, need editor, organization, or key in " cite$ * warning$
""
}
{ key sortify }
if$
}
{ "The " #4 organization chop.word sortify }
if$
}
{ editor sort.format.names }
if$
FUNCTION {presort}
{ type$ "book" =
type$ "inbook" =
'author.editor.sort
{ type$ "proceedings" =
'editor.organization.sort
{ type$ "manual" =
'author.organization.sort
'author.sort
if$
}
if$
}
if$
" "
year field.or.null sortify
" "
title field.or.null
sort.format.title
#1 entry.max$ substring$
'sort.key$ :=
%</!ay&!seq-no>
%<*(ay)|!seq-no>
ITERATE {presort}
SORT
%</(ay)|!seq-no>
%<*ay>
STRINGS { last.label next.extra }
INTEGERS { last.extra.num }
FUNCTION {initialize.extra.label.stuff}
{ #0 int.to.chr$ 'last.label :=
"" 'next.extra :=
#0 'last.extra.num :=
FUNCTION {forward.pass}
{ last.label label =
{ last.extra.num #1 + 'last.extra.num :=
last.extra.num int.to.chr$ 'extra.label :=
}
{ "a" chr.to.int$ 'last.extra.num :=
"" 'extra.label :=
label 'last.label :=
}
if$
FUNCTION {reverse.pass}
{ next.extra "b" =
{ "a" 'extra.label := }
'skip$
if$
extra.label 'next.extra :=
%<xlab-it> extra.label emphasize 'extra.label :=
%<!(har|ast|cay|cn)> label extra.label * 'label :=
EXECUTE {initialize.extra.label.stuff}
ITERATE {forward.pass}
REVERSE {reverse.pass}
FUNCTION {bib.sort.order}
{ sort.label
" "
year field.or.null sortify
" "
title field.or.null
sort.format.title
#1 entry.max$ substring$
'sort.key$ :=
%<har|cay|cn|ast> calc.short.label
%<har|cay> calc.long.label
ITERATE {bib.sort.order}
SORT
%</ay>
%<*!ay>
STRINGS { longest.label }
INTEGERS { number.label longest.label.width }
FUNCTION {initialize.longest.label}
{ "" 'longest.label :=
#1 'number.label :=
#0 'longest.label.width :=
FUNCTION {longest.label.pass}
%<*!ay&!cite>
{ number.label int.to.str$ 'label :=
number.label #1 + 'number.label :=
%</!ay&!cite>
%<!ay&cite>{ cite$ 'label :=
label width$ longest.label.width >
{ label 'longest.label :=
label width$ 'longest.label.width :=
}
'skip$
if$
EXECUTE {initialize.longest.label}
ITERATE {longest.label.pass}
%</!ay>
FUNCTION {begin.bib}
{ preamble$ empty$
'skip$
{ preamble$ write$ newline$ }
if$
%<ay> "\begin{thebibliography}{}" write$ newline$
%<!ay> "\begin{thebibliography}{" longest.label * "}" * write$ newline$
EXECUTE {begin.bib}
EXECUTE {init.state.consts}
ITERATE {call.type$}
FUNCTION {end.bib}
{ newline$
"\end{thebibliography}" write$ newline$
EXECUTE {end.bib}
%</!options>
% \end{macrocode}
% \Finale